Add OpenBSD support to qmake project (#464)
authorRalf Horstmann <ralf+github@ackstorm.de>
Sun, 19 Jan 2020 22:28:12 +0000 (23:28 +0100)
committertsteven4 <13596209+tsteven4@users.noreply.github.com>
Sun, 19 Jan 2020 22:28:12 +0000 (15:28 -0700)
* Add OpenBSD support to qmake project

* Set HAVE_LINUX_HID only on Linux in CMakeLists.txt

CMakeLists.txt
GPSBabel.pro

index 91f785de7cf8d53518addcbd9ea6e8471bfa1771..044e7eb95266712296262e7eed2df4a2b0c5fd31 100644 (file)
@@ -219,8 +219,11 @@ if(MSVC)
   add_compile_options(/MP -wd4100)
 endif()
 
-if (UNIX AND NOT APPLE)
+if (CMAKE_SYSTEM_NAME MATCHES "Linux")
   add_definitions(-DHAVE_LINUX_HID)
+endif()
+
+if (UNIX AND NOT APPLE)
   set(LIBS ${LIBS} usb-1.0)
 endif()
 
index 10172a3597979395ddc0fb57bc80b98e0662f9ba..d08db3e17a9c2a2b53d5f19a6d483e73916aff06 100644 (file)
@@ -172,7 +172,7 @@ load(configure)
 
 CONFIG(release, debug|release): DEFINES *= NDEBUG
 
-macx|linux {
+macx|linux|openbsd {
   qtCompileTest(unistd) {
     # this is used by zlib
     DEFINES += HAVE_UNISTD_H
@@ -207,6 +207,9 @@ win32-msvc* {
 
 linux {
   DEFINES += HAVE_LINUX_HID
+}
+
+linux|openbsd {
   LIBS += "-lusb-1.0"
 }
 
@@ -249,14 +252,14 @@ DEFINES += CSVFMTS_ENABLED
 QMAKE_CFLAGS_WARN_ON -= -W
 QMAKE_CXXFLAGS_WARN_ON -= -W
 
-macx|linux{
+macx|linux|openbsd{
   check.commands = PNAME=./$(TARGET) ./testo
   check.depends = $(TARGET)
   QMAKE_EXTRA_TARGETS += check
 }
 
 # build the compilation data base used by clang tools including clang-tidy.
-macx|linux{
+macx|linux|openbsd{
   compile_command_database.target = compile_commands.json
   compile_command_database.commands = make clean; bear make
   QMAKE_EXTRA_TARGETS += compile_command_database